package cn.mesmile.order.fallback;

import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

/**
 * @author zb
 * @date 2020/12/16 18:36
 * @Description
 */
@Slf4j
public class AccountServiceClientFallbackFactory implements FallbackFactory<AccountServiceClient> {

    @Override
    public AccountServiceClient create(Throwable throwable) {

        return new AccountServiceClient() {

            @Override
            public Boolean deductBalance(Long accountId, BigDecimal price) {
                return false;
            }
        };

    }


}
